from sgfmill import sgf

class sgf_tools():
    def __init__(self,size):
        self.game=sgf.Sgf_game(size)
    def record_game(self,color,move):
        node = self.game.extend_main_sequence()
        node.set_move(color,move)
    def set_sgf(self,key,value):
        node = self.game.get_root()
        node.set(key,value)
    def save(self,pathName):
        with open(pathName, "wb") as f:
            f.write(self.game.serialise())
    
